{extend name="public/base" /}
{block name="button"}
       <a href='{:url("pay-coins/add")}'  class='layui-btn layui-btn-sm layui-btn-primary'>添加币种</a>
{/block}
{block name="content"}
        <form class="layui-form layui-form-pane form-search" action="{:url()}" onsubmit="return false" method="post" autocomplete="off">
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">币种代码</label>
                <label class="layui-input-inline">
                    <input name="coin_name" value="" placeholder="" class="layui-input">
                </label>
            </div>
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">状态</label>
                <div class="layui-input-inline">
                    <select name="pay_status" lay-search class="layui-select">
                        <option value='0'>全部</option>
                        <option value='1'>启用</option>
                        <option value='-1'>禁用</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-inline">
                <label class="layui-form-label">提现状态</label>
                <div class="layui-input-inline">
                    <select name="withdraw_status" lay-search class="layui-select">
                        <option value='0'>全部</option>
                        <option value='1'>启用</option>
                        <option value='-1'>禁用</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item layui-inline">
                <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i>搜索</button>
            </div>
        </form>
        <table id="PayCoinsTable"  data-url="{:url('index')}" data-target-search="form.form-search"></table>
{/block}
{block name='script'}
<script>
    $(function () {
        $.menu.highlight_subnav("{:url('pay-coins/index')}")
        $('#PayCoinsTable').layTable({
            even: true,
            height: 'full',
            method: 'post',
            sort: {field: 'sort', type: 'asc'},
            url: "{:url('index')}" ,
            where: {
                coin_name: "",
                pay_status: 0,
                withdraw_status: 0,

            },
            page: true,
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'id', title: 'id', width: 30, align: 'center',sort: true},
                {field: 'coin_name', title: '币种代码', width: 80, align: 'center'},
                {
                    field: 'icon', title: 'icon', width: 60, align: 'center', templet: function (d) {
                        if (!d.icon) return '-';
                        return layui.laytpl('<div class="headimg headimg-ss shadow-inset margin-0" data-tips-image data-tips-hover data-lazy-src="{{d.icon}}"></div>').render(d);
                    }
                },
                {field: 'network', title: '充币网络', align: 'left', width: 100},
                {field: 'pay_status', title: '充值状态', align: 'center', width: 80,templet:function (d){
                         return d.pay_status ==1 ? "可用":"不可用";
                }},
                {field: 'address', title: '充币地址', align: 'left', width: 300},
                {field: 'withdraw_status', title: '提现状态', align: 'center', width: 80,templet:function (d){
                        return d.withdraw_status ==1 ? "可用":"不可用";
                }},
                {field: 'sort', title: '排序', align: 'center', width: 80, sort: true},
                {field: 'withdraw_max_num', title: '最大提币数量', align: 'left'},
                {field: 'withdraw_min_num', title: '最小提币数量', align: 'left'},
                {field: 'create_at', title: '创建时间', align: 'center', width: 150, sort: true},
                {field: 'update_at', title: '更新时间', align: 'center',width: 150, sort: true},
                {field: 'update_operator', title: '更新人账户', align: 'center', width: 120},
                {toolbar: '#toolbar', title: '操作面板', align: 'center', width: 120, fixed: 'right'}
            ]]
        });

    });
</script>




<script type="text/html" id="toolbar">
    <a class="layui-btn layui-btn-sm" data-event-dbclick data-title="编辑用户" href='{:url("pay-coins/edit")}?id={{d.id}}'>编 辑</a>
</script>
{/block}
